<html>
<head>
  <title>论如何在手机上使用git</title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="description" content="教你怎么在手机上优雅的使用git">
<meta property="og:type" content="article">
<meta property="og:title" content="论如何在手机上使用git">
<meta property="og:url" content="https://txmu.gitee.io/2020/10/10/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="教你怎么在手机上优雅的使用git">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2020-10-10">
<meta property="article:modified_time" content="2020-10-10">
<meta property="article:author" content="txmu">
    <link rel="alternate" href="/atom.xml" title="Hexo" type="application/atom+xml">
  
  
    <link rel="icon" href="/favicon.png">
  
  
    <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css">
  
  
<link rel="stylesheet" href="/css/style.css">

<meta name="generator" content="Hexo 5.2.0"></head>

<body>
  <div id="container">
    <div id="wrap">
      <header id="header">
  <div id="banner"></div>
  <div id="header-outer" class="outer">
    <div id="header-title" class="inner">
      <h1 id="logo-wrap">
        <a href="/" id="logo">Hexo</a>
      </h1>
      
    </div>
    <div id="header-inner" class="inner">
      <nav id="main-nav">
        <a id="main-nav-toggle" class="nav-icon"></a>
        
          <a class="main-nav-link" href="/">Home</a>
        
          <a class="main-nav-link" href="/archives">Archives</a>
        
      </nav>
      <nav id="sub-nav">
        
          <a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
        
        <a id="nav-search-btn" class="nav-icon" title="搜索"></a>
      </nav>
      <div id="search-form-wrap">
        <form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit">&#xF002;</button><input type="hidden" name="sitesearch" value="https://txmu.gitee.io"></form>
      </div>
    </div>
  </div>
</header>
      <div class="outer">
        <section id="main"><article id="post-hello-world" class="article article-type-post" itemscope itemprop="blogPost">
  <div class="article-meta">
    <a href="/2020/10/08/hello-world/" class="article-date">
  <time datetime="2020-10-08T12:26:33.397Z" itemprop="datePublished">2020-10-08</time>
</a>
    
  </div>
  <div class="article-inner">
    
    
      <header class="article-header">
        
  
    <h1 class="article-title" itemprop="name">
      论如何在手机上使用git
    </h1>
  

      </header>
      
     <div class="article-entry" itemprop="articleBody">
<p><b>title: 论如何在手机上使用git</b></p>
<p>date: 2020-10-09 19:28:09</p>
<h2 id="tags-">tags:教程</h2>
<p>准备工具:安卓手机一台(安卓7.0以上)，utermux
</p><p><a href="https://pan.baidu.com/s/1nWqcYv8Htfojos21fmIrzw#/multshare/%2FUTermux%E5%8E%86%E5%8F%B2%E7%89%88%E6%9C%AC%2F/%2FTermux_%E8%87%AA%E7%94%A8%E5%8C%85%2F%E5%85%A8%E9%83%A8%E6%89%A9%E5%B1%95%E5%8C%85">ut链接，提取码mjvu</a></p>
<p><b>开工!</b></p>
<p>打开ut,执行以下命令:
</p><pre><code class="lang-zsh" style="font-size:15px">$ pkg install git
</code></pre>
<p>有y/n这种提示直接选y就可以。</p>
<br/>
安装完之后使用git --version检测一下。
<br/>
现在应该可以用git clone了，但是你可能想用手机ssh连接gitee,github和gitlab。
</code></pre><p>  执行命令:</p>
<pre><code class="lang-zsh" style="font-size:15px">$ ssh-keygen -t rsa -C youremail@youremail.com
PS:上面的命令要是生成失败就用atilo安装个debian再在debian里生成。三次回车即可生成。
</code></pre>
<pre><code style="font-size:15px">执行命令cat ~/.ssh/id_rsa.pub查看公匙。

然后注册gitee,github和gitlab账号，把公匙在设置里面添加一下。

<b>gitee,github和gitlab可以用一个公匙。</b>
</code></pre>
<p><b>添加后，在终端输入:</b></p>
<pre><code class="lang-zsh" style="font-size:15px">
#Gitee
 $ ssh -T git@gitee.com

#GitHub
 $ ssh -T git@github.com

#Gitlab
 $ ssh -T git@gitlab.com
</code></pre>
<pre><code style="font-size:15px">第一次绑定的时候输入上边的代码之后会提示是否continue,输入yes后程序会自动连接，如果要求登录，直接输入登录信息即可。

再次执行上面的命令，检查是否成功连接，如果返回一下信息，则表示添加成功
</code></pre><p>You've successfully authenticated, but GitHub does not provide shell access.(github,gitee也差不多，但是gitlab的不太一样)</p>
<p>   接下来我们要设置一些信息:</p>
<pre><code class="lang-zsh" style="font-size:15px">$ git config --global user.name &quot;yourname&quot;
$ git config --global user.email &quot;youremail@youremail.com&quot;
</code></pre>
<pre><code style="font-size:15px"><b>name尽量和码云或GitHub保持一致，但email必须是码云或GitHub注册时使用的邮箱。命令不分前后，没有顺序。</b>

<p><i>git使用教程自己找吧(比如https://www.cnblogs.com/yiven/p/8465054.html)</i></p>

<p><b>END</b></p>
</code></pre>
</div>
    <footer class="article-footer">
      <a data-url="https://txmu.gitee.io/2020/10/08/hello-world/" data-id="ckg0tz1hy000087s68bss2y20" class="article-share-link">Share</a>
      
      
    </footer>
  </div>
  
    
  
</article>

</section>
        
          <aside id="sidebar">
  
    

  
    

  
    
  
    
  <div class="widget-wrap">
    <h3 class="widget-title">归档</h3>
    <div class="widget">
      <ul class="archive-list"><li class="archive-list-item"><a class="archive-list-link" href="/archives/2020/10/">十月 2020</a></li></ul>
    </div>
  </div>


  
    
  <div class="widget-wrap">
    <h3 class="widget-title">最新文章</h3>
    <div class="widget">
      <ul>
        
          <li>
      <a href="/home/">请前往索引页查看</a>
            </li>
        
      </ul>
    </div>
  </div>

  
</aside>
        
      </div>
      <footer id="footer">
  
  <div class="outer">
    <div id="footer-info" class="inner">
      &copy; 2020 txmu<br>
      Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
    </div>
  </div>
</footer>
    </div>
    <nav id="mobile-nav">
  
    <a href="/" class="mobile-nav-link">Home</a>
  
    <a href="/archives" class="mobile-nav-link">Archives</a>
  
</nav>
    

<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script>


  
<link rel="stylesheet" href="/fancybox/jquery.fancybox.css">

  
<script src="/fancybox/jquery.fancybox.pack.js"></script>




<script src="/js/script.js"></script>




  </div>
<body>
<html>
